function []=ps_triggered_activity(velP_ind,velM_ind,ROI_act_ms)

refract_time=100;
l_win=5000;
r_win=10000;
min_dur=10;

[ps_start]=parse_cond_starts(velP_ind&~velM_ind,min_dur,refract_time);

[mo_start]=parse_cond_starts(velP_ind&velM_ind,min_dur,refract_time);

% act=ftfil(ROIs(sel_roi).activity,18,0,10);
% act=psmooth(act);
% act=act/median(act);

%[ROI_act_ms]=map_ROI_act_to_aux_data(act,frame_times,length(aux_data));

ps_trig_snips=[];
for ind=1:length(ps_start)
    try
        ps_trig_snips(:,ind)=ROI_act_ms(ps_start(ind)-l_win:ps_start(ind)+r_win);
    end
end

mo_trig_snips=[];
for ind=1:length(mo_start)
    try
        mo_trig_snips(:,ind)=ROI_act_ms(mo_start(ind)-l_win:mo_start(ind)+r_win);
    end
end

figure;
subplot(211)
hold on
plot([-l_win:r_win],ps_trig_snips,'color',[1 1 1]*0.5)
plot([-l_win:r_win],mean(ps_trig_snips'),'k','linewidth',3)
yl=ylim;
plot([0 0],yl,'k');
ylabel('dF/F')
xlabel('Time [ms]')

subplot(212)
hold on
plot([-l_win:r_win],mo_trig_snips,'color',[1 1 1]*0.5)
plot([-l_win:r_win],mean(mo_trig_snips'),'k','linewidth',3)
yl=ylim;
plot([0 0],yl,'k');
ylabel('dF/F')
xlabel('Time [ms]')










